<template>
    <div class="box">
    {{ getMsg }}，home组件
    <button @click="sendMsg">sendMsg</button>
    </div>
</template>
<script>
export default{
        data(){
            return{
                msg : "hello"
            }
        },
        props :{
            getMsg:{
                type : String,
                default : ""
            }
        },
        methods:{
            sendMsg(){
                this.$emit("myevent",msg)
            }
        }
    }
</script>
<style lang="scss" scoped>
    .box{
        background-color:red
    }
</style>